<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<%
	String id = request.getParameter("id");
	if (id == null) {
		id = "";
	}
%>
<script type="text/javascript">
$(function(){


		$('#areaid').combotree({
			url : '${ctx}/autoinn/area/treegrid',
			idFiled : 'id',
			textFiled : 'text',
			parentField : 'pid',
			lines : true
		});
		
	<% if(id!=""){%>

	 $.post('${ctx}/autoinn/store/ser/json?id=' +$(':input[name="id"]').val(), {
			id : $(':input[name="id"]').val(),
		}, function(result) {
			if (result !=null && result.id != undefined) {
				$('form').form('load', {
					'id' : result.id,
					'name' :result.name,
					'areaid' :result.areaid,
					'address' :result.address,
					'state' : result.state,
					'intro' :result.intro,
					'tel' :result.tel,
                    'logo' : result.logo,
                    'lng' : result.lng,
                    'lat' : result.lat,
                    'ismaintenance' : result.ismaintenance
				});
				if(result.logo!=null && result.logo!="" && result.logo!=undefined){
					//设置图片预览
					$("#logo_yl").attr("src","${ctx}/upload/"+result.logo); 
				}
				//$('#iconCls').attr('class', result.iconCls);//设置背景图标
			}
			$.messager.progress('close');
		}, 'json');
	 
<%}%>
}); 		
</script>
<div align="center" id="dil">
	<form id="store_updateForms" method="post" class="zzld_form">

		<input type="hidden" name="id" value="<%=id %>" /> <br />
		<table class="zzld_table" cellpadding="1" cellspacing="1"
			style="width: 100%">
			<tr>
				<th>门店:</th>
				<td class="stdinput"><input name="name" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请编辑登录名!" style="width: 98%;" /></td>
				<th>区域:</th>
				<td class="stdinput"><input id="areaid" name="areaid"
					class="easyui-combotree" style="width: 155px;" /></td>
			</tr>
			<tr>
				<th>地址:</th>
				<td colspan="3"><input name="address" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请编辑工号!" style="width: 98%;" /></td>
			</tr>
			<tr>
				<th>是否提供保养(维修):</th>
				<td colspan="3"><select name="ismaintenance" id="ismaintenance">
				<option value="0">不提供</option>
				  <option value="1">提供</option>  
				</select></td>
			</tr>
			<tr>
				<th>是否启用</th>
				<td class="stdinput"><select name="state">
						<option value="1">启用</option>
						<option value="0">未启动</option>
				</select></td>
				<th>联系电话:</th>
				<td class="stdinput"><input name="tel" value=""
					class="easyui-validatebox" data-options="required:true"
					missingMessage="请填写联系电话!" style="width: 73%;" /></td>
			</tr>
			<tr>
				<th>经度:</th>
				<td class="stdinput"><input name="lng"
					class="easyui-numberspinner"
					data-options="required:true,min:-999.99999999,max:999.99999999,"
					missingMessage="请输入经度" precision="8" increment="0.00000001"
					style="width: 155px;" value="100" /></td>
				<th>纬度:</th>
				<td class="stdinput"><input name="lat"
					class="easyui-numberspinner"
					data-options="required:true,min:-999.9999999,max:999.9999999,"
					missingMessage="请输入纬度" precision="8" increment="0.000000001"
					style="width: 155px;" value="100" /></td>
			</tr>

			<tr>
				<th>排序</th>
				<td class="stdinput"><input name="lng"
					class="easyui-numberspinner"
					data-options="required:true,min:0.00000,max:100000,"
					missingMessage="请输入序号" precision="3" increment="0.001"
					style="width: 155px;" value="100" /></td>
				<th>门店简介:</td>
				<td><textarea name="intro"></textarea></td>
			</tr>
			<tr>
				<th>门店图片</th>
				<td colspan="3">
					<fieldset class="step">
						<div style="margin: 5px;">
							<%--用来作为文件队列区域--%>
							<div id="fileQueue"></div>
							<input type="file" name="file" id="fileup"
								data-options="required:true" missingMessage="请编辑登录名!" /> <input
								type="hidden" name="logo" id="logo" />
						</div>
					</fieldset>
				</td>
			</tr>
			<tr>
				<td colspan="4">
					<img id="logo_yl"  src="" style="width: 100%; height: 200px;">
				</td>
			</tr>

		</table>

	</form>
</div>